<template>
  <div class="my-article">
    <myartic-item :artiList="artiList" />
    <el-empty v-if="artiList.length==0"
              description="您还没发布文章"></el-empty>
  </div>
</template>

<script>
import myarticItem from '@/components/MyArticItem.vue' // 文章组件
import { myArticle } from '@/api/article'
export default {
  components: {
    myarticItem
  },
  data() {
    return {
      artiList: []
    }
  },
  methods: {
    // 获取个人发布文章
    async initMyArticle() {
      let { data: res } = await myArticle()
      console.log(res)
      this.artiList = res.data
    }
  },
  created() {
    this.initMyArticle()
  }
}
</script>

<style>
</style>